package com.csy.user;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "com.csy")
public class UserApplication {
	private static final Logger LOG = LoggerFactory.getLogger(UserApplication.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext ctxt = SpringApplication.run(UserApplication.class, args);
		LOG.info("------------------------------- 开始测试拉取配置中心属性 -------------------------------");
		
		String url = ctxt.getEnvironment().getProperty("spring.datasource.url");
		LOG.info(">> spring.datasource.url: {}", url);
		
		String logicDeleteValue = ctxt.getEnvironment().getProperty("mybatis-plus.global-config.db-config.logic-delete-value");
		LOG.info(">> logicDeleteValue: {}", logicDeleteValue);
		
		String logicNotDeleteValue = ctxt.getEnvironment().getProperty("mybatis-plus.global-config.db-config.logic-not-delete-value");
		LOG.info(">> logicNotDeleteValue: {}", logicNotDeleteValue);
		
		LOG.info("------------------------------- 配置中心属性拉取测试完毕 -------------------------------");
    }

}
